package com.jeffse.light.stream.core.data.state;

import com.jeffse.light.stream.core.data.descriptor.stateDescriptor.ValueStateDescriptor;
import net.sf.ehcache.Element;

public class ValueState<T> extends State {
	public ValueState(ValueStateDescriptor stateDescriptor){
		super();
		this.stateDescriptor = stateDescriptor;
	}

	public T value() {
		Element element = backends.getState(stateDescriptor);
		if (element != null){
			return (T)element.getObjectValue();
		}
		return null;
	};

}